package experiment_2.Complex;
import java.util.*;
/**
 * Created by Administrator on 2016/4/14.
 */
public class ComplexCount {
    public static void main(String[] args) {
        Scanner scanner=new Scanner(System.in);
        Complex a=new Complex(0,0);                     //建立实例
        Complex b=new Complex(0,0);
        Complex c=new Complex(0,0);
        System.out.println("请输入a的实部和虚部");
        double r1=scanner.nextDouble();
        double i1=scanner.nextDouble();
        System.out.println("请输入b的实部和虚部");
        double r2=scanner.nextDouble();                      //输入实部和虚部
        double i2=scanner.nextDouble();
        a.SetRealPart(r1);
        a.SetImaginaryPart(i1);
        b.SetRealPart(r2);
        b.SetImaginaryPart(i2);
        c = a.Add(b);                          //加法
        c.putout(c);
        c = a.Minus(b);                       //减法
        c.putout(c);
        c = a.Multi(b);
        c.putout(c);
    }
}
